<!-- options of text inside tooltip -->
<fb:js-string var="content_delete">delete message</fb:js-string>
<fb:js-string var="content_play">play message</fb:js-string>
<fb:js-string var="content_respond">respond to sender</fb:js-string>
<fb:js-string var="content_send">send this message</fb:js-string>

<script>
/* Offset position of tooltip */
var x_offset_tooltip = 30;
var y_offset_tooltip = 5;
var tooltipObj = false;

/* Creates&Shows the tooltip */
function showTooltip(inputObj,type)
{
	if(!tooltipObj)	/* Tooltip div not created yet ? */
	{
		tooltipObj = document.createElement('DIV');
		tooltipObj.setClassName('tooltipObj');
		tooltipObj.setId('tooltipObj');		
		document.getRootElement().appendChild(tooltipObj);
		
		var contentDiv = document.createElement('DIV'); /* Create tooltip content div */
		contentDiv.setClassName('tooltip_content');
		contentDiv.setId('tooltip_content');
		tooltipObj.appendChild(contentDiv);
		contentDiv.id  = 'tooltip_content';
			
	}
	
	// Find position of tooltip
	tooltipObj.setStyle('display','block');
	showContent('tooltip_content',type);
	positionTooltip(inputObj);
}

/* Establish tooltip positioning */
function positionTooltip(inputObj)
{
	var leftPos = Tooltip_getLeftPos(inputObj);
	var topPos = Tooltip_getTopPos(inputObj);
	tooltipObj.setStyle('left',leftPos + 'px');
	tooltipObj.setStyle('top',topPos + 'px');	
}

function Tooltip_getTopPos(inputObj)
{		
	var returnValue = inputObj.getAbsoluteTop() - inputObj.getOffsetHeight() + y_offset_tooltip;
	return returnValue;
}

function Tooltip_getLeftPos(inputObj)
{
  var returnValue = inputObj.getAbsoluteLeft() - 415 + x_offset_tooltip; //3 cells in inner table
  return returnValue;
}

/* Hide tooltip */
function hideTooltip()
{
	tooltipObj.setStyle('display','none');
}

/* Choose tooltip content according to type parameter*/
function showContent(divId,type)
{
	switch (type) {
	case 1: 
		var content = content_delete;
		break;
	case 2:
		var content = content_play;
		break;		
	case 3:
		var content = content_respond;
		break;		
	case 4:
		var content = content_send;
		break;
	}	
	document.getElementById(divId).setInnerFBML(content);
}

function highlightRow(obj)
{
	obj.setStyle('background','#FFF');
}

function cancelRow(obj)
{
	if (obj.getClassName()=="notRead") {
		obj.setStyle('background','#c3cddf');
	} else {
		obj.setStyle('background','#f7f7f7');
	}
}
</script>